home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / news / inn1.000 / inn1.4sec-linux-src.tar / inn / lib / writev.c < prev    next >
C/C++ Source or Header  |  1993-01-29  |  389b  |  25 lines

  1. /*  $Revision: 1.3 $
  2. **
  3. */
  4. #include <stdio.h>
  5. #include <sys/types.h>
  6. #include <sys/uio.h>
  7.  
  8.  
  9. /*
  10. **  "Fake" writev for sites without it.
  11. */
  12. int
  13. writev(fd, vp, vpcount)
  14.     int            fd;
  15.     struct iovec    *vp;
  16.     int            vpcount;
  17. {
  18.     int            count;
  19.  
  20.     for (count = 0; --vpcount >= 0; count += vp->iov_len, vp++)
  21.     if (xwrite(fd, vp->iov_base, vp->iov_len) < 0)
  22.         return -1;
  23.     return count;
  24. }
  25.